<?php echo $header ?>
<?php //echo $slider ?>
<?php echo $googlemap; ?>
<?php  $mainPhoto = base_url() . "uploads/" . $item->photo; ?>
<div class="wrap-content">
    <div class="container container-property">
        <div class="row">
            <div class="span9">
                <h2><?php echo $estate->title ?></h2>
                <?php $images = json_decode($estate->photoGallery); ?>
                <div class="propertyCarousel">
                    <div id="myCarousel" class="carousel slide">
                    <ol class="carousel-indicators">
                    <?php $num=0; ?>
                    <?php foreach ($images as $image) { 
                        $first_active = '';
                         if($num==0)$first_active = 'active';
                    ?>
                    <li data-target="#myCarousel" data-slide-to="<?php echo $num ?>" class="<?php echo $first_active; ?>"></li>
                    <?php $num++ ?>
                    <?php } ?>
                    </ol>
                    <!-- Carousel items -->
                    <div class="carousel-inner">
                    <?php $n=0; ?>
                    <?php foreach ($images as $image) { 
                         $first_active = '';
                            if($n==0)$first_active = 'active';
                    ?>
                        <div class="item <?php echo $first_active; ?>">
                        <img alt="" src="<?php echo base_url() . "uploads/" . $image ?>" />
                        </div>
                    <?php $n++ ?>     
                    <?php } ?>
                    </div>
                    <!-- Carousel nav -->
                    <a class="carousel-control left" href="#myCarousel" data-slide="prev">&lsaquo;</a>
                    <a class="carousel-control right" href="#myCarousel" data-slide="next">&rsaquo;</a>
                    </div>
                </div>
                <div class="property_content">
                    <h2>Description</h2>
                    <div class="row">
                        <div class="span12">      
                            <?php echo $estate->content; ?>
                        </div>
                    </div>
                    
                    <div class="row-fluid">
                        <div class="span12">    
                            <ul class="amenities">  
                             <?php
                            $one = TRUE;
                            $two = TRUE;
                            $three = TRUE;
                            ?>
                            <?php foreach ($properties as $key => $prop) { ?>
                                <?php
                                if ($prop->typeID == 1 and $one == TRUE) {
                                    echo "<br style='clear: both;'><h2 style='clear:both;' >" . lang("single_hardware") . "</h2>";
                                    $one = FALSE;
                                }
                                ?>
                                <?php
                                if ($prop->typeID == 2 and $two == TRUE) {
                                    echo "<br style='clear: both;'><h2 style='clear:both;'>" . lang("single_out_hardware") . "</h2>";
                                    $two = FALSE;
                                }
                                ?>
                                <?php
                                if ($prop->typeID == 3 and $three == TRUE) {
                                    echo "<br style='clear: both;'><h2 style='clear:both;'>" . lang("single_envirenment") . "</h2>";
                                    $three = FALSE;
                                }
                                ?>
                                <li> <label><i class="<?php echo ($prop->value) ? "icon-check" : "icon-check-empty" ?>"></i><?php echo $prop->name ?> </label></li>
                            <?php } ?>
                                </ul>
                        </div>
                    </div>
                  
                    <br style="clear: both;" />
                    <h2>Property Location</h2>
                    <div id="propertyLocation">
                    </div>
                    <h2>Image Galley</h2>
                    <ul data-target="#modal-gallery" data-toggle="modal-gallery" class="files files-list ui-sortable">
                       
                       <?php foreach ($images as $image) { ?>
                        <li class="template-download fade in">
                            <a data-gallery="gallery" href="<?php echo base_url() . "uploads/" . $image ?>" title="<?php echo $image; ?>" download="<?php echo base_url() . "uploads/" . $image ?>" class="preview show-icon">
                                <img src="<?php echo base_url('assets/theme/blue/img/preview-icon.png'); ?>" class="hidden" />
                            </a>
                            <div class="preview-img"><img src="<?php echo base_url() . "uploads/" . $image ?>" data-src="<?php echo base_url() . "uploads/" . $image ?>" alt="{filename}" class="" /></div>
                        </li>
                        <?php } ?>
                    </ul>
                    <br style="clear:both;" />
                </div>
            </div>
            <div class="span3">
                 <h2>Overview</h2>
                  <div class="property_options">
                    <p class="bottom-border"><strong><?php echo lang('content_fprice') ?></strong> <span  class="label label-success"><?php echo number_format($estate->price, 0, ".", ","); ?></span>
                    <br style="clear: both;" />
                    </p>
                   
                    <p class="bottom-border"><strong><?php echo lang('single_date') ?></strong> <span><?php echo date("d F Y", strtotime($estate->addedDate)) ?></span>
                    <br style="clear: both;" />
                    </p>

                    <p class="bottom-border"><strong><?php echo lang('content_heating') ?></strong> <span><?php echo $estate->heating ?></span>
                    <br style="clear: both;" />
                    </p>

                    <p class="bottom-border"><strong><?php echo lang('content_bathroom') ?></strong> <span><?php echo $estate->bathroom ?></span>
                    <br style="clear: both;" />
                    </p>

                    <p class="bottom-border"><strong><?php echo lang('content_buildstatus') ?></strong> <span  class="label label-success"><?php echo $estate->buildstatus ?></span>
                    <br style="clear: both;" />
                    </p>

                    <p class="bottom-border"><strong><?php echo lang('content_room') ?></strong> <span><?php echo $estate->room ?></span>
                    <br style="clear: both;" />
                    </p>

                    <p class="bottom-border"><strong><?php echo lang('content_estate_type') ?></strong> <span><?php echo $estate->estateName ?></span>
                    <br style="clear: both;" />
                    </p>

                    <p class="bottom-border"><strong><?php echo lang('content_estate_floor') ?></strong> <span><?php echo $estate->floor ?></span>
                    <br style="clear: both;" />
                    </p>

                    <p class="bottom-border"><strong><?php echo lang('content_squaremeter') ?></strong> <span  class="label label-success"><?php echo $estate->squaremeter ?></span>
                    <br style="clear: both;" />
                    </p>

                    <p class="bottom-border"><strong><?php echo lang('content_category') ?></strong> <span class="label label-success"><?php echo $estate->catName ?></span>
                    <br style="clear: both;" />
                    </p>
                  </div>                 
            </div>
    </div>
</div>
<script language="javascript">
 $(document).ready(function(){
        $('#propertyLocation').gmap3({
         map:{
            options:{
             center: [<?php echo $estate->gps; ?>],
             zoom: 8,
             scrollwheel: false
            }
         },
         marker:{
            values:[
                {latLng:[<?php echo $estate->gps; ?>], options:{icon: "<?php echo base_url('assets/theme/blue/img/marker_blue.png'); ?>"}, data:"{estate_data_address}"},
            ]
         }});
});     
</script> 
<?php echo $footer ?>